﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void BtnOK_Click(object sender, EventArgs e)
    {
        if (this.TxtNewMm.Text == "" || this.TxtQrMm.Text == "")
        {
            Page.RegisterStartupScript("", "<script>alert('新密码或确认密码的值不能为空！ ')</script>");
        }
        else
        {
            if (this.TxtNewMm.Text != this.TxtQrMm.Text)
            {
                Page.RegisterStartupScript("", "<script>alert('两次输入的密码不相同，请重新输入新密码和确认密码的值！ ')</script>");
            }
            else
            {
                string str1 = this.TxtOldMm.Text.ToString();
                string str2 = this.TxtNewMm.Text.ToString();
                //使用Replace方法替换字符串
                string str = str1.Replace(str1, str2);
                Page.RegisterStartupScript("", "<script>alert('恭喜您！原密码 123456 已成功替换为：" + str + "')</script>");
            }
        }
        
    }
}
